package com.wx.wxapp.controller;

import com.wx.wxapp.entity.Disease;
import com.wx.wxapp.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class DiseaseController {
    @Autowired
    private DiseaseService diseaseService;


    /*
     *   功能：获取用户关于疾病的发帖纪录
     *   参数：
     *       openid:用户的openid
     * */
    @RequestMapping(value = "/getHistoryDiseaseCards",method = RequestMethod.GET)
    public List<List<String>> GetHistoryDiseaseCards(@RequestParam("openid")String openid){
        return diseaseService.getHistoryDiseaseCard(openid);
    }

    /*
     *   功能：获取关于疾病的帖子
     *   参数:
     */
    @RequestMapping(value = "/getDiseaseCards",method = RequestMethod.GET)
    public Map GetDiseaseCards(@RequestParam("pageNumber")int pageNumber){
        return diseaseService.getDiseaseCard(pageNumber);
    }

}
